#include "BinaryTree.h"

int main()
{
    printf("-------------------------------------------------------------------\n");

    printf("前/中/后/层序遍历：\n");
    char* a="ABD##E#H##CF##G##";
    BTNode* T;
    int cur=0;//字符串数组a的位置标
    T= BinaryTreeCreate(a,&cur);
    BinaryTreePrevOrder(T);
    printf("\n");
    BinaryTreeInOrder(T);
    printf("\n");
    BinaryTreePostOrder(T);
    printf("\n");
    BinaryTreeLevelOrder(T);

    printf("-------------------------------------------------------------------\nT1节点个数:\n");

    printf("节点个数=%d\n",BinaryTreeSize(T));
    printf("叶子节点个数=%d\n",BinaryTreeLeafSize(T));
    int k=3;
    printf("第%d层节点个数=%d\n",k,BinaryTreeLevelKSize(T,k));

    printf("-------------------------------------------------------------------\nT1\n");

    BTNode* F=BinaryTreeFind(T,'J');
    //1为完全 0为不完全
    int com1=BinaryTreeComplete(T);
    BinaryTreePrevOrder(T);
    printf("\n");
    printf("是否为完全二叉树：%d\n",com1);  

    printf("-------------------------------------------------------------------\nT2\n");
    
    char* b="ABDH###E##CF##G##";
    BTNode* T2;
    int cur2=0;
    T2=BinaryTreeCreate(b,&cur2);
    BinaryTreePrevOrder(T2);
    printf("\n");
    //1为完全 0为不完全
    int com2=BinaryTreeComplete(T2);
    printf("是否为完全二叉树：%d\n",com2);

    printf("-------------------------------------------------------------------\nT3\n");

    BTNode* T3;
    int p=0;
    char* ab="abc##de#g##f###";
    T3=BinaryTreeCreate(ab, &p);
    BinaryTreeInOrder(T3);



    return 0;
}